home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: Stuart Stevens <stevens@corp.hp.com>
- Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Subject: Re: C coding problem
- Date: 16 Mar 1996 11:20:14 -0600
- Organization: Corporate News Server
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4iet8e$avl@solutions.solon.com>
- References: <4ianbf$h86@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.05 9000/715)
- X-Url: news:4ianbf$h86@solutions.solon.com
-
- This is a multi-part message in MIME format.
-
- ---------------------------------206301264331340
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
-
- By any chance is "read_options" a pointer to char?
-
- option_val = read_options
-
- ---------------------------------206301264331340
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain
-
- From: proctor@corp.hp.com (Stephen Proctor)
- Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Subject: C coding problem
- Date: 14 Mar 1996 21:14:55 -0600
- Organization: Corporate News Server
- Message-ID: <4ianbf$h86@solutions.solon.com>
-
- Greetings,
-
- I am trying to write a *simple* C program and am running into the following
- warning problem shown below. Why do I get this warning?
-
- It seems to have an effect on the logic of the program when executed.
-
- I am try to examine the first character in a command line argument, argv[],
- to the program for the presence of a "-" sign to identify the argument as
- an option.
-
- Thanks for any help that can be sent my way.
-
- Regards, Steve
-
- Note: c89 is the HP-UX POSIX-conformant C compiler
-
- Where can a list of warning and error codes be found for this compiler?
-
- 1.) The following is the compilation line and the resulting warning message,
-
- % c89 shell.c -o shell
- cc: "shell.c", line 98: warning 608: Illegal integer-pointer
- combination in assignment.
-
- 2.) The program is as follows,
-
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <stdlib.h>
-
- main(int argc, char *argv[])
- {
- int ii;
- int option_val = 0;
- /* skip lines */
- for (ii=1; ii<argc; ii++) {
- /* skip lines */
- /* The next line is the offending line */
- if (*argv[ii] == '-') option_val = read_options;
- /* skip lines */
- return 0; /* Program executed successfully */
- }
-
- ---------------------------------206301264331340--
-